package com.wysql.ascost.model.info;

import java.util.ArrayList;
import java.util.Date;
import java.util.List;

import cn.hutool.core.util.StrUtil;

/**
 * 协议库存信息查询--主表 InfoContractstoreExample
 * @author wysqlauto_自动生成
 * @date 2025-03-11 10:00:31
 */
public class InfoContractstoreExample {

    protected String orderByClause;

    protected boolean distinct;

    protected List<Criteria> oredCriteria;

    public InfoContractstoreExample() {
        oredCriteria = new ArrayList<Criteria>();
    }

    public void setOrderByClause(String orderByClause) {
        this.orderByClause = orderByClause;
    }

    public String getOrderByClause() {
        return orderByClause;
    }

    public void setDistinct(boolean distinct) {
        this.distinct = distinct;
    }

    public boolean isDistinct() {
        return distinct;
    }

    public List<Criteria> getOredCriteria() {
        return oredCriteria;
    }

    public void or(Criteria criteria) {
        oredCriteria.add(criteria);
    }

    public Criteria or() {
        Criteria criteria = createCriteriaInternal();
        oredCriteria.add(criteria);
        return criteria;
    }

    public Criteria createCriteria() {
        Criteria criteria = createCriteriaInternal();
        if (oredCriteria.size() == 0) {
            oredCriteria.add(criteria);
        }
        return criteria;
    }

    protected Criteria createCriteriaInternal() {
        Criteria criteria = new Criteria();
        return criteria;
    }

    public void clear() {
        oredCriteria.clear();
        orderByClause = null;
        distinct = false;
    }

    protected abstract static class GeneratedCriteria {
        protected List<Criterion> criteria;

        protected GeneratedCriteria() {
            super();
            criteria = new ArrayList<Criterion>();
        }

        public boolean isValid() {
            return criteria.size() > 0;
        }

        public List<Criterion> getAllCriteria() {
            return criteria;
        }

        public List<Criterion> getCriteria() {
            return criteria;
        }

        protected void addCriterion(String condition) {
            if (condition == null) {
                throw new RuntimeException("Value for condition cannot be null");
            }
            criteria.add(new Criterion(condition));
        }

        protected void addCriterion(String condition, Object value, String property) {
            if (value == null) {
                throw new RuntimeException("Value for " + property + " cannot be null");
            }
            criteria.add(new Criterion(condition, value));
        }

        protected void addCriterion(String condition, Object value1, Object value2, String property) {
            if (value1 == null || value2 == null) {
                throw new RuntimeException("Between values for " + property + " cannot be null");
            }
            criteria.add(new Criterion(condition, value1, value2));
        }

        
            public Criteria andIdIsNull() {
                addCriterion("id is null");
                return (Criteria) this;
            }

            public Criteria andIdIsNotNull() {
                addCriterion("id is not null");
                return (Criteria) this;
            }

            public Criteria andIdEqualTo(String value) {
                addCriterion("id =", value, "id");
                return (Criteria) this;
            }

            public Criteria andIdNotEqualTo(String value) {
                addCriterion("id <>", value, "id");
                return (Criteria) this;
            }

            public Criteria andIdGreaterThan(String value) {
                addCriterion("id >", value, "id");
                return (Criteria) this;
            }

            public Criteria andIdGreaterThanOrEqualTo(String value) {
                addCriterion("id >=", value, "id");
                return (Criteria) this;
            }

            public Criteria andIdLessThan(String value) {
                addCriterion("id <", value, "id");
                return (Criteria) this;
            }

            public Criteria andIdLessThanOrEqualTo(String value) {
                addCriterion("id <=", value, "id");
                return (Criteria) this;
            }

            public Criteria andIdLike(String value) {
                addCriterion("id like", value, "id");
                return (Criteria) this;
            }

            public Criteria andIdNotLike(String value) {
                addCriterion("id not like", value, "id");
                return (Criteria) this;
            }

            public Criteria andIdIn(List<String> values) {
                addCriterion("id in", values, "id");
                return (Criteria) this;
            }

            public Criteria andIdNotIn(List<String> values) {
                addCriterion("id not in", values, "id");
                return (Criteria) this;
            }

            public Criteria andIdBetween(String value1, String value2) {
                addCriterion("id between", value1, value2, "id");
                return (Criteria) this;
            }

            public Criteria andIdNotBetween(String value1, String value2) {
                addCriterion("id not between", value1, value2, "id");
                return (Criteria) this;
            }

        
            public Criteria andFilenameIsNull() {
                addCriterion("filename is null");
                return (Criteria) this;
            }

            public Criteria andFilenameIsNotNull() {
                addCriterion("filename is not null");
                return (Criteria) this;
            }

            public Criteria andFilenameEqualTo(String value) {
                addCriterion("filename =", value, "filename");
                return (Criteria) this;
            }

            public Criteria andFilenameNotEqualTo(String value) {
                addCriterion("filename <>", value, "filename");
                return (Criteria) this;
            }

            public Criteria andFilenameGreaterThan(String value) {
                addCriterion("filename >", value, "filename");
                return (Criteria) this;
            }

            public Criteria andFilenameGreaterThanOrEqualTo(String value) {
                addCriterion("filename >=", value, "filename");
                return (Criteria) this;
            }

            public Criteria andFilenameLessThan(String value) {
                addCriterion("filename <", value, "filename");
                return (Criteria) this;
            }

            public Criteria andFilenameLessThanOrEqualTo(String value) {
                addCriterion("filename <=", value, "filename");
                return (Criteria) this;
            }

            public Criteria andFilenameLike(String value) {
                addCriterion("filename like", value, "filename");
                return (Criteria) this;
            }

            public Criteria andFilenameNotLike(String value) {
                addCriterion("filename not like", value, "filename");
                return (Criteria) this;
            }

            public Criteria andFilenameIn(List<String> values) {
                addCriterion("filename in", values, "filename");
                return (Criteria) this;
            }

            public Criteria andFilenameNotIn(List<String> values) {
                addCriterion("filename not in", values, "filename");
                return (Criteria) this;
            }

            public Criteria andFilenameBetween(String value1, String value2) {
                addCriterion("filename between", value1, value2, "filename");
                return (Criteria) this;
            }

            public Criteria andFilenameNotBetween(String value1, String value2) {
                addCriterion("filename not between", value1, value2, "filename");
                return (Criteria) this;
            }

        
            public Criteria andCreattimeIsNull() {
                addCriterion("creattime is null");
                return (Criteria) this;
            }

            public Criteria andCreattimeIsNotNull() {
                addCriterion("creattime is not null");
                return (Criteria) this;
            }

            public Criteria andCreattimeEqualTo(Date value) {
                addCriterion("creattime =", value, "creattime");
                return (Criteria) this;
            }

            public Criteria andCreattimeNotEqualTo(Date value) {
                addCriterion("creattime <>", value, "creattime");
                return (Criteria) this;
            }

            public Criteria andCreattimeGreaterThan(Date value) {
                addCriterion("creattime >", value, "creattime");
                return (Criteria) this;
            }

            public Criteria andCreattimeGreaterThanOrEqualTo(Date value) {
                addCriterion("creattime >=", value, "creattime");
                return (Criteria) this;
            }

            public Criteria andCreattimeLessThan(Date value) {
                addCriterion("creattime <", value, "creattime");
                return (Criteria) this;
            }

            public Criteria andCreattimeLessThanOrEqualTo(Date value) {
                addCriterion("creattime <=", value, "creattime");
                return (Criteria) this;
            }

            public Criteria andCreattimeLike(Date value) {
                addCriterion("creattime like", value, "creattime");
                return (Criteria) this;
            }

            public Criteria andCreattimeNotLike(Date value) {
                addCriterion("creattime not like", value, "creattime");
                return (Criteria) this;
            }

            public Criteria andCreattimeIn(List<Date> values) {
                addCriterion("creattime in", values, "creattime");
                return (Criteria) this;
            }

            public Criteria andCreattimeNotIn(List<Date> values) {
                addCriterion("creattime not in", values, "creattime");
                return (Criteria) this;
            }

            public Criteria andCreattimeBetween(Date value1, Date value2) {
                addCriterion("creattime between", value1, value2, "creattime");
                return (Criteria) this;
            }

            public Criteria andCreattimeNotBetween(Date value1, Date value2) {
                addCriterion("creattime not between", value1, value2, "creattime");
                return (Criteria) this;
            }

        
            public Criteria andVertionIsNull() {
                addCriterion("vertion is null");
                return (Criteria) this;
            }

            public Criteria andVertionIsNotNull() {
                addCriterion("vertion is not null");
                return (Criteria) this;
            }

            public Criteria andVertionEqualTo(String value) {
                addCriterion("vertion =", value, "vertion");
                return (Criteria) this;
            }

            public Criteria andVertionNotEqualTo(String value) {
                addCriterion("vertion <>", value, "vertion");
                return (Criteria) this;
            }

            public Criteria andVertionGreaterThan(String value) {
                addCriterion("vertion >", value, "vertion");
                return (Criteria) this;
            }

            public Criteria andVertionGreaterThanOrEqualTo(String value) {
                addCriterion("vertion >=", value, "vertion");
                return (Criteria) this;
            }

            public Criteria andVertionLessThan(String value) {
                addCriterion("vertion <", value, "vertion");
                return (Criteria) this;
            }

            public Criteria andVertionLessThanOrEqualTo(String value) {
                addCriterion("vertion <=", value, "vertion");
                return (Criteria) this;
            }

            public Criteria andVertionLike(String value) {
                addCriterion("vertion like", value, "vertion");
                return (Criteria) this;
            }

            public Criteria andVertionNotLike(String value) {
                addCriterion("vertion not like", value, "vertion");
                return (Criteria) this;
            }

            public Criteria andVertionIn(List<String> values) {
                addCriterion("vertion in", values, "vertion");
                return (Criteria) this;
            }

            public Criteria andVertionNotIn(List<String> values) {
                addCriterion("vertion not in", values, "vertion");
                return (Criteria) this;
            }

            public Criteria andVertionBetween(String value1, String value2) {
                addCriterion("vertion between", value1, value2, "vertion");
                return (Criteria) this;
            }

            public Criteria andVertionNotBetween(String value1, String value2) {
                addCriterion("vertion not between", value1, value2, "vertion");
                return (Criteria) this;
            }

        
            public Criteria andMemoIsNull() {
                addCriterion("memo is null");
                return (Criteria) this;
            }

            public Criteria andMemoIsNotNull() {
                addCriterion("memo is not null");
                return (Criteria) this;
            }

            public Criteria andMemoEqualTo(String value) {
                addCriterion("memo =", value, "memo");
                return (Criteria) this;
            }

            public Criteria andMemoNotEqualTo(String value) {
                addCriterion("memo <>", value, "memo");
                return (Criteria) this;
            }

            public Criteria andMemoGreaterThan(String value) {
                addCriterion("memo >", value, "memo");
                return (Criteria) this;
            }

            public Criteria andMemoGreaterThanOrEqualTo(String value) {
                addCriterion("memo >=", value, "memo");
                return (Criteria) this;
            }

            public Criteria andMemoLessThan(String value) {
                addCriterion("memo <", value, "memo");
                return (Criteria) this;
            }

            public Criteria andMemoLessThanOrEqualTo(String value) {
                addCriterion("memo <=", value, "memo");
                return (Criteria) this;
            }

            public Criteria andMemoLike(String value) {
                addCriterion("memo like", value, "memo");
                return (Criteria) this;
            }

            public Criteria andMemoNotLike(String value) {
                addCriterion("memo not like", value, "memo");
                return (Criteria) this;
            }

            public Criteria andMemoIn(List<String> values) {
                addCriterion("memo in", values, "memo");
                return (Criteria) this;
            }

            public Criteria andMemoNotIn(List<String> values) {
                addCriterion("memo not in", values, "memo");
                return (Criteria) this;
            }

            public Criteria andMemoBetween(String value1, String value2) {
                addCriterion("memo between", value1, value2, "memo");
                return (Criteria) this;
            }

            public Criteria andMemoNotBetween(String value1, String value2) {
                addCriterion("memo not between", value1, value2, "memo");
                return (Criteria) this;
            }

        
            public Criteria andIsdeleteIsNull() {
                addCriterion("isdelete is null");
                return (Criteria) this;
            }

            public Criteria andIsdeleteIsNotNull() {
                addCriterion("isdelete is not null");
                return (Criteria) this;
            }

            public Criteria andIsdeleteEqualTo(Integer value) {
                addCriterion("isdelete =", value, "isdelete");
                return (Criteria) this;
            }

            public Criteria andIsdeleteNotEqualTo(Integer value) {
                addCriterion("isdelete <>", value, "isdelete");
                return (Criteria) this;
            }

            public Criteria andIsdeleteGreaterThan(Integer value) {
                addCriterion("isdelete >", value, "isdelete");
                return (Criteria) this;
            }

            public Criteria andIsdeleteGreaterThanOrEqualTo(Integer value) {
                addCriterion("isdelete >=", value, "isdelete");
                return (Criteria) this;
            }

            public Criteria andIsdeleteLessThan(Integer value) {
                addCriterion("isdelete <", value, "isdelete");
                return (Criteria) this;
            }

            public Criteria andIsdeleteLessThanOrEqualTo(Integer value) {
                addCriterion("isdelete <=", value, "isdelete");
                return (Criteria) this;
            }

            public Criteria andIsdeleteLike(Integer value) {
                addCriterion("isdelete like", value, "isdelete");
                return (Criteria) this;
            }

            public Criteria andIsdeleteNotLike(Integer value) {
                addCriterion("isdelete not like", value, "isdelete");
                return (Criteria) this;
            }

            public Criteria andIsdeleteIn(List<Integer> values) {
                addCriterion("isdelete in", values, "isdelete");
                return (Criteria) this;
            }

            public Criteria andIsdeleteNotIn(List<Integer> values) {
                addCriterion("isdelete not in", values, "isdelete");
                return (Criteria) this;
            }

            public Criteria andIsdeleteBetween(Integer value1, Integer value2) {
                addCriterion("isdelete between", value1, value2, "isdelete");
                return (Criteria) this;
            }

            public Criteria andIsdeleteNotBetween(Integer value1, Integer value2) {
                addCriterion("isdelete not between", value1, value2, "isdelete");
                return (Criteria) this;
            }

        
        public Criteria andLikeQuery(InfoContractstore record) {
            List<String> list = new ArrayList<String>();
            List<String> list2 = new ArrayList<String>();
            StringBuffer buffer = new StringBuffer();
                            if (record.getId() != null && StrUtil.isNotEmpty(record.getId().toString())) {
                    list.add("ifnull(id,'')");
                }
                            if (record.getFilename() != null && StrUtil.isNotEmpty(record.getFilename().toString())) {
                    list.add("ifnull(filename,'')");
                }
                            if (record.getCreattime() != null && StrUtil.isNotEmpty(record.getCreattime().toString())) {
                    list.add("ifnull(creattime,'')");
                }
                            if (record.getVertion() != null && StrUtil.isNotEmpty(record.getVertion().toString())) {
                    list.add("ifnull(vertion,'')");
                }
                            if (record.getMemo() != null && StrUtil.isNotEmpty(record.getMemo().toString())) {
                    list.add("ifnull(memo,'')");
                }
                            if (record.getIsdelete() != null && StrUtil.isNotEmpty(record.getIsdelete().toString())) {
                    list.add("ifnull(isdelete,'')");
                }
                                        if (record.getId() != null && StrUtil.isNotEmpty(record.getId().toString())) {
                    list2.add("'%" + record.getId() + "%'");
                }
                            if (record.getFilename() != null && StrUtil.isNotEmpty(record.getFilename().toString())) {
                    list2.add("'%" + record.getFilename() + "%'");
                }
                            if (record.getCreattime() != null && StrUtil.isNotEmpty(record.getCreattime().toString())) {
                    list2.add("'%" + record.getCreattime() + "%'");
                }
                            if (record.getVertion() != null && StrUtil.isNotEmpty(record.getVertion().toString())) {
                    list2.add("'%" + record.getVertion() + "%'");
                }
                            if (record.getMemo() != null && StrUtil.isNotEmpty(record.getMemo().toString())) {
                    list2.add("'%" + record.getMemo() + "%'");
                }
                            if (record.getIsdelete() != null && StrUtil.isNotEmpty(record.getIsdelete().toString())) {
                    list2.add("'%" + record.getIsdelete() + "%'");
                }
                        buffer.append(" CONCAT(");
            buffer.append(StrUtil.join(",", list));
            buffer.append(")");
            buffer.append(" like CONCAT(");
            buffer.append(StrUtil.join(",", list2));
            buffer.append(")");
            if (!" CONCAT() like CONCAT()".equals(buffer.toString())) {
                addCriterion(buffer.toString());
            }
            return (Criteria) this;
        }

        public Criteria andLikeQuery2(String searchText) {
            List<String> list = new ArrayList<String>();
            StringBuffer buffer = new StringBuffer();
                            list.add("ifnull(id,'')");
                            list.add("ifnull(filename,'')");
                            list.add("ifnull(creattime,'')");
                            list.add("ifnull(vertion,'')");
                            list.add("ifnull(memo,'')");
                            list.add("ifnull(isdelete,'')");
                        buffer.append(" CONCAT(");
            buffer.append(StrUtil.join(",", list));
            buffer.append(")");
            buffer.append("like '%");
            buffer.append(searchText);
            buffer.append("%'");
            addCriterion(buffer.toString());
            return (Criteria) this;
        }

    }

    public static class Criteria extends GeneratedCriteria {
        protected Criteria() {
            super();
        }
    }

    public static class Criterion {
        private String condition;

        private Object value;

        private Object secondValue;

        private boolean noValue;

        private boolean singleValue;

        private boolean betweenValue;

        private boolean listValue;

        private String typeHandler;

        public String getCondition() {
            return condition;
        }

        public Object getValue() {
            return value;
        }

        public Object getSecondValue() {
            return secondValue;
        }

        public boolean isNoValue() {
            return noValue;
        }

        public boolean isSingleValue() {
            return singleValue;
        }

        public boolean isBetweenValue() {
            return betweenValue;
        }

        public boolean isListValue() {
            return listValue;
        }

        public String getTypeHandler() {
            return typeHandler;
        }

        protected Criterion(String condition) {
            super();
            this.condition = condition;
            this.typeHandler = null;
            this.noValue = true;
        }

        protected Criterion(String condition, Object value, String typeHandler) {
            super();
            this.condition = condition;
            this.value = value;
            this.typeHandler = typeHandler;
            if (value instanceof List<?>) {
                this.listValue = true;
            } else {
                this.singleValue = true;
            }
        }

        protected Criterion(String condition, Object value) {
            this(condition, value, null);
        }

        protected Criterion(String condition, Object value, Object secondValue, String typeHandler) {
            super();
            this.condition = condition;
            this.value = value;
            this.secondValue = secondValue;
            this.typeHandler = typeHandler;
            this.betweenValue = true;
        }

        protected Criterion(String condition, Object value, Object secondValue) {
            this(condition, value, secondValue, null);
        }
    }
}